package com.wx.chapter10.final_.innerclass;

/**
 * ClassName:StaticInnerClass01
 * Package :com.wx.chapter10.final_.innerclass
 * Description :
 *
 * @Author : coder_mu
 * @Create : 2023/6/12 - 9:25
 */
public class StaticInnerClass01 {
    public static void main(String[] args) {
        Outer10 outer10 = new Outer10();
        outer10.m1();
        Outer10.Inner10 inner10 = new Outer10.Inner10();
        inner10.say();
        Outer10.Inner10 inner101 = outer10.getInner10();
        inner101.say();
        Outer10.Inner10 inner10_ = Outer10.getInner10_();
        inner10_.say();
    }
}

class Outer10 {
    private int n1 = 10;
    private static String name = "张三";

    private static void cry() {
    }

    static class Inner10 {
        private static String name = " 韩顺平教育";//属性重复时，就近原则访问

        public void say() {
            System.out.println(name + "  外部类 name= " + Outer10.name);//静态成员没有this
        }
    }

    public void m1() {
        Inner10 inner10 = new Inner10();
        inner10.say();
    }

    public Inner10 getInner10() {//返回对象
        return new Inner10();
    }

    public static Inner10 getInner10_() {
        return new Inner10();
    }
}

